home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_25150.txt < prev    next >
Text File  |  1991-02-27  |  1KB  |  39 lines

  1. -- card: 25150 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. STRUCTURES
  11.  
  12. The most useful kind of custom data type is the structure, or record.  The structure groups several different data types together so they may be manipulated using a single name.  A structure representing a personnel record may look like:
  13.  
  14.     struct    personnel_rec
  15.     {
  16.         char    name[80];
  17.         int    id_number;
  18.         float    salary;
  19.     };
  20.  
  21. The name, or TAG, of this new data type follows identifier naming rules*.  (Some programmers capitalize the first or all letters of the tag.)  Although the foregoing defines the new data type, it does not yet allocate space for a variable having this type.  A new variable named jack is declared using:
  22.  
  23.  
  24.  
  25. -- part contents for background part 7
  26. ----- text -----
  27. 66
  28.  
  29. -- part contents for background part 29
  30. ----- text -----
  31. 22558
  32.  
  33. -- part contents for background part 27
  34. ----- text -----
  35. Identifier naming conventions
  36.  
  37. -- part contents for background part 20
  38. ----- text -----
  39. Identifier naming conventions - p51